home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 13 / CU Amiga Magazine's Super CD-ROM 13 (1997)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1997-08].iso / CUCD / Graphics / Ghostscript / batch / ps2ascii < prev    next >
Text File  |  1997-04-12  |  639b  |  17 lines

  1. #!/bin/sh
  2. # Extract ASCII text from a PostScript file.  Usage:
  3. #    ps2ascii [infile.ps [outfile.txt]]
  4. # If outfile is omitted, output goes to stdout.
  5. # If both infile and outfile are omitted, ps2ascii acts as a filter,
  6. # reading from stdin and writing on stdout.
  7.  
  8. trap "rm -f _temp_.err _temp_.out" 0 1 2 15
  9.  
  10. if ( test $# -eq 0 ) then
  11.     gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps - -c quit
  12. elif ( test $# -eq 1 ) then
  13.     gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps $1 -c quit
  14. else
  15.     gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps $1 -c quit >$2
  16. fi
  17.